
#include "communicatUart1Tx.h"
#include "communicatUart1Rx.h"
#include "dma.h"
#include "baseData.h"

/**send to pc**
*0xfd+0xfd+37*6+check=2+222+1=225
*/
void uart1SendUpdate(void)
{
	uint8_t checksum=0;
	uint8_t sendTmp[225];
	sendTmp[0]=0xfd;
	sendTmp[1]=0xfd;
	
	From_to.Usart3_to_Usart1[0]=DeviceInfo.pack;
	From_to.Usart3_to_Usart1[1]=DeviceInfo.voltage;
	From_to.Usart3_to_Usart1[2]=DeviceInfo.height;
	From_to.Usart3_to_Usart1[3]=DeviceInfo.shake;
	From_to.Usart3_to_Usart1[4]=DeviceInfo.tick++;
	//From_to.Usart3_to_Usart1[5]=null;
	
	for(uint8_t i=0;i<222;i++)
	{ 
		sendTmp[i+2]=From_to.Usart3_to_Usart1[i];
	}
	
	for(uint8_t i=2;i<=223;i++)
	{
		checksum+=sendTmp[i];
	}
	
	sendTmp[224]=checksum;
	
	dma1senddatatransplant(sendTmp,225);
	//dmaUart1SendData(sendTmp,225);
	
}

 



